<template>
<div>

  <div class="chain-link-bar-wrapper">
    <el-breadcrumb separator-class="el-icon-arrow-right">
      <el-breadcrumb-item>企业列表</el-breadcrumb-item>
      <el-breadcrumb-item to="/store">企业列表</el-breadcrumb-item>
      <el-breadcrumb-item :to="'/member/storeDetail/' + member.store_id">详情：{{member.name}}</el-breadcrumb-item>
    </el-breadcrumb>  
  </div>

  <el-card class="box-card">
    
    <div slot="header" class="clearfix">
      <h3 class="app-h3 app-margin-v-0">
        企业详情
      </h3>
    </div>

    <div class="app-diliver-10"></div>
    
    <el-row :gutter="80">
      <el-col :span="12">
        
        <el-row>
          <el-col :span="24">
            <h4 class="app-h4 app-margin-v-0">企业信息</h4>
          </el-col>
        </el-row>
        <div class="app-diliver-10"></div>
        <el-row class="app-section">
          <el-col :span="3">
            <span class="app-label">logo：</span>
          </el-col>
          <el-col :span="20">
            <img :src="member.logo" class="app-list-head-img">
          </el-col>
          <el-col :span="3">
            <span class="app-label">企业名称：</span>
          </el-col>
          <el-col :span="20">
            <span class="app-text">{{member.name}}&nbsp;</span>
          </el-col>
          <el-col :span="3">
            <span class="app-label">简介：</span>
          </el-col>
          <el-col :span="20">
            <span class="app-text">{{member.intro}}&nbsp;</span>
          </el-col>
          <el-col :span="3">
            <span class="app-label">服务电话：</span>
          </el-col>
          <el-col :span="20">
            <span class="app-text">{{member.service_phone}}&nbsp;</span>
          </el-col>
          <el-col :span="3">
            <span class="app-label">成立日期：</span>
          </el-col>
          <el-col :span="20">
            <span class="app-text">{{member.establish_date}}&nbsp;</span>
          </el-col>
          <el-col :span="3">
            <span class="app-label">导航地址：</span>
          </el-col>
          <el-col :span="20">
			  <span class="app-text">{{ member.address_detail}}</span>
          </el-col>
          <el-col :span="3">
            <span class="app-label">主营：</span>
          </el-col>
          <el-col :span="20">
            <span class="app-text">{{ member.main}}</span>
          </el-col>
          <el-col :span="3">
            <span class="app-label">注册时间：</span>
          </el-col>
          <el-col :span="20">
            <span class="app-text">{{member.create_date_time}}&nbsp;</span>
          </el-col>
        </el-row>
      </el-col>

      <el-col :span="12">
        
        <el-row>
          <el-col :span="24">
            <h4 class="app-h4 app-margin-v-0">审核状态</h4>
          </el-col>
        </el-row>

        <div class="app-diliver-10"></div>
        
        <el-row class="app-section">
          <el-col :span="3">
            <span class="app-label">状态：</span>
          </el-col>
          <el-col :span="20">
            <span class="app-text">            
              <el-button v-if="member.check_status == 'NOT'"  size="mini">未审核</el-button>
              <el-button v-if="member.check_status == 'PASS'" type="success"  size="mini">已通过</el-button>
              <el-button v-if="member.check_status == 'FAIL'" type="danger"  size="mini">未通过</el-button>&nbsp;
            </span>
          </el-col>

          <el-col :span="3">
            <span class="app-label">审核说明：</span>
          </el-col>
          <el-col :span="20">
            <span class="app-text">{{member.check_status_explain}}&nbsp;</span>
          </el-col>

          <el-col :span="3">
            <span class="app-label">审核时间：</span>
          </el-col>
          <el-col :span="20">
            <span class="app-text">{{member.check_date_time}}&nbsp;</span>
          </el-col>
        </el-row>

        <el-row>
          <el-col :span="24">
            <h4 class="app-h4 app-margin-b-0">图片信息</h4>
          </el-col>
        </el-row>

        <div class="app-diliver-10"></div>

        <el-row class="app-section">
          <el-col :span="3">
            <span class="app-label">封面：</span>
          </el-col>
          <el-col :span="20">
            <el-image class="section-img-wh-200" :fit="'cover'" v-if="member.cover != null" v-for="url in member.cover" :preview-src-list="member.cover"  :src="url" />
          </el-col>
          <el-col :span="3">
            <span class="app-label">实景图片：</span>
          </el-col>
          <el-col :span="20">
            <el-image class="section-img-wh-200" :fit="'cover'" v-if="member.img != null" v-for="url in member.img" :preview-src-list="member.img"  :src="url" />
          </el-col>
          <el-col :span="3">
            <span class="app-label">实景图片：</span>
          </el-col>
          <el-col :span="20">
            <el-image class="section-img-wh-200" :fit="'cover'" v-if="member.company_honor != null" v-for="url in member.company_honor" :preview-src-list="member.company_honor"  :src="url" />
          </el-col>
          <el-col :span="3">
            <span class="app-label">营业执照：</span>
          </el-col>
          <el-col :span="20">
            <el-image class="section-img-wh-200" :fit="'cover'" v-if="member.business_photo != null" v-for="url in member.business_photo" :preview-src-list="member.business_photo"  :src="url" />
          </el-col>
          <el-col :span="3">
            <span class="app-label">网店凭证：</span>
          </el-col>
          <el-col :span="20">
            <el-image class="section-img-wh-200" :fit="'cover'" v-if="member.proof_photo != null" v-for="url in member.proof_photo" :preview-src-list="member.proof_photo"  :src="url" />
          </el-col>
        </el-row>
      </el-col>

    </el-row>
    
    

  </el-card>

</div>
</template>


<script>

  import NcButton from '../common/NcButton'
  import SubmitButton from '../common/SubmitButton'

  import Api from '../../api/Api'
  import MemberApi from '../../api/MemberApi'
	//需要导入vuex的数据管理
	import Store from '../../store/index.js'


  export default {
  	components: {
  		NcButton, SubmitButton
  	},
  	data(){
  	  return {
        storeId: 0,
        member: {},
		role: ''
  	  }
  	},
  	computed: {
  	  
  	},
  	created(){
  	  this.storeId = this.$route.params.storeId;
      this.getMember();
	  this.role = Store.state.user.role;
  	},
    watch: {
      '$route' (to, from) {
        this.storeId = to.params.storeId;
        this.getMember();
      }
    },
  	methods: {
      getMember(){
        MemberApi.storeDetail(this.storeId, json => {
          this.member = json.store;
        });
      }
  	}
  }
</script>

